package vip.liux.backend.infrastructure.textTemplate;

import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotBlank;

import java.util.Locale;
import java.util.Map;

public interface TemplateRenderer {

    default String render(@NotBlank String template){
        return render(template, null);
    }

    default String render(@NotBlank String template, @Nullable Map<String, Object> model) {
        return render(template, model, null);
    }

    default String render(@NotBlank String template, @Nullable Map<String, Object> model, @Nullable Locale locale){
        return render(template, model, locale, null);
    }

    String render(@NotBlank String template, @Nullable Map<String, Object> model, @Nullable Locale locale, @Nullable Map<String, Object> globalContext);
}
